﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Private/Privada.master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="HRP.Private.Departamentos.Index" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PrivadaMainContent" runat="server">
    <div class="md-modal md-fade-in-scale-up" id="md-fade-in-scale-up">
        <div class="md-content">
            <h3>Modal Dialog</h3>
            <div>
                <p>This is a modal window. You can do the following things with it:</p>
                <ul>
                    <li><strong>Read:</strong> modal windows will probably tell you something important so don't forget to read what they say.</li>
                    <li><strong>Look:</strong> a modal window enjoys a certain kind of attention; just look at it and appreciate its presence.</li>
                    <li><strong>Close:</strong> click on the button below to close the modal.</li>
                </ul>
                <p>
                    <button class="btn btn-danger md-close">Close me!</button>
                    <button class="btn btn-success md-close">Some button</button>
                </p>
            </div>
        </div>
    </div>


    <div class="box-info full">
        <h2><strong>Departamentos</strong></h2>

        <div class="data-table-toolbar">
            <div class="row">
                <div class="col-md-4">
                    <%--                    <form role="form">
                        <input type="text" class="form-control" placeholder="Search...">
                    </form>--%>
                </div>
                <div class="col-md-8">
                    <div class="toolbar-btn-action">
                        <a class="btn btn-success md-trigger" href="Criar.aspx">Criar Novo Departamento <i class="fa fa-plus-circle"></i></a>
                        <a class="btn btn-danger">Apagar <i class="fa fa-trash-o"></i></a>
                        <%--                        <a class="btn btn-primary"><i class="fa fa-refresh"></i>Update</a>--%>
                    </div>
                </div>
            </div>
            <%if (departamentosTable.Items.Count == 0)
              { %>
            <h5>Não tem departamentos registados.
            </h5>
            <%} %>
        </div>
        <%if (departamentosTable.Items.Count > 0)
          { %>
        <asp:Repeater runat="server" ID="departamentosTable">
            <HeaderTemplate>
                <div class="table-responsive">
                    <table data-sortable class="table table-hover table-striped">
                        <thead>
                            <tr>
                                <th style="width: 30px" data-sortable="false">
                                    <input type="checkbox" class="rows-check"></th>
                                <th>Nome</th>
                                <th>Observação</th>
                                <th>Data de Criação</th>
                                <th>Activo</th>
                                <th data-sortable="false">Opção</th>
                            </tr>
                        </thead>
                        <tbody>
            </HeaderTemplate>
            <ItemTemplate>

                <tr>
                    <td>
                        <input type="checkbox" class="rows-check"></td>
                    <td><%#Eval("departamento") %></td>
                    <td><%#Eval("observacao") %></td>
                    <td><%#((DateTime)Eval("data_criacao")).ToString(HRP.Utilidades.DefinicoesSite.DataFormato) %></td>
                    <td><span class="label <%#(bool)Eval("activo") ? "label-success" : "label-danger"%> "><%#(bool)Eval("activo") ? "Sim" : "Não"%></span></td>
                    <td>
                        <div class="btn-group btn-group-xs">
                            <asp:LinkButton ID="activarDesButton" data-toggle="tooltip" ToolTip='<%#(bool)Eval("activo") ? "Desactivar" : "Activar"%>' CssClass="btn btn-default" runat="server" CommandArgument='<%#Eval("id") %>' OnCommand="alterarEstadoDep"><i class="fa fa-power-off"></i></asp:LinkButton>
                            <a href='Editar.aspx?id=<%#Eval("id") %>' data-toggle="tooltip" title="Editar" class="btn btn-default"><i class="fa fa-edit"></i></a>
                        </div>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate></tbody></table></div></FooterTemplate>
        </asp:Repeater>



        <!-- TODO: Pagination -->
        <%--        <div class="data-table-toolbar">
            <ul class="pagination">
                <li class="disabled"><a href="#">&laquo;</a></li>
                <li class="active"><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li><a href="#">&raquo;</a></li>
            </ul>
        </div>--%>
        <%} %>
    </div>


</asp:Content>
